<?php
class ControllerAccountLoginForm extends Controller
{
    public function index()
    {
        $this->load->model('account/customer');
        $this->language->load('account/login');
        $this->load->helper('html');

        $this->data['heading_title'] = $this->language->get('heading_title');

        $this->data['text_new_customer'] = $this->language->get('text_new_customer');
        $this->data['text_register'] = $this->language->get('text_register');
        $this->data['text_register_account'] = $this->language->get('text_register_account');
        $this->data['text_returning_customer'] = $this->language->get('text_returning_customer');
        $this->data['text_i_am_returning_customer'] = $this->language->get('text_i_am_returning_customer');
        $this->data['text_forgotten'] = $this->language->get('text_forgotten');

        $this->data['entry_email'] = $this->language->get('entry_email');
        $this->data['entry_password'] = $this->language->get('entry_password');

        $this->data['button_continue'] = $this->language->get('button_continue');
        $this->data['button_login']=getSubmitButton(array(
            'value'=>$this->language->get('button_login'),
            'button_class'=>'button',
            'button_id'=>'login-submit-button',
            'autofocus'=>true,
        ));

        if (isset($this->error['warning'])) {
            $this->data['error_warning'] = $this->error['warning'];
        } else {
            $this->data['error_warning'] = '';
        }

        $this->data['action'] = $this->url->link('account/login', '', 'SSL');
        $this->data['register'] = $this->url->link('account/register', '', 'SSL');
        $this->data['forgotten'] = $this->url->link('account/forgotten', '', 'SSL');
        $this->data['register_link']=$this->url->link('account/register', '', 'SSL');

        /*
        if (isset($this->request->post['email'])) {
            $this->data['email'] = $this->request->post['email'];
        } else {
            $this->data['email'] = '';
        }

        if (isset($this->request->post['password'])) {
            $this->data['password'] = $this->request->post['password'];
        } else {
            $this->data['password'] = '';
        }
        */

        $this->template='default/template/account/login_form.tpl';

        if(!$this->customer->isLogged()) $this->response->setOutput($this->render());
    }
}